from pydantic import BaseModel

class ItemModel(BaseModel):
    name: str
    price: float
    is_offer: bool = None

class MaterialSpecificationsModel(BaseModel):
    item_id: int = None
    name: str
    spec: str = None
    unit: str = None
    count: int = None
    price_per_unit: float = None
    total_price: float = None

class MaterialCountModel(BaseModel):
    specifications: list[MaterialSpecificationsModel]
    address: str
    total_price: float = None

class AddressModel(BaseModel):
    item_id: int
    address: str

class MaterialRequestModel(BaseModel):
    material_counts: list[MaterialCountModel]
    request_id: int
    user: str
    total_price: float = 0.0
    datetime: str